<?php

use Biz\model\activity\SNJActivityRecord;

/**
 * @deprecated
 * 三棱镜 广告活动记录
 * Class SNJRecordAction
 */
class GetSNJCaseListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    const  CASE_UIDS =['55010' , '538297'];

    const CASE_PIC_URL = [
        '55010' => 'https://img.haohaozhu.cn/App-imageShow/o_nphone/521/9a89023402c07l200qzgp645xiuh?w=750&h=562.5&iv=1',
        '538297' => 'https://img.haohaozhu.cn/App-imageShow/o_nphone/521/9a89023402c07l200qzgp645xiuh?w=750&h=562.5&iv=1',
    ];

    public function main()
    {
        $data = [];
        $info = SNJActivityRecord::getRecordListByCondition([
            'AND' => [
                'uid' => self::CASE_UIDS,
                'type' => SNJActivityRecord::NORMAL_TYPE
            ],
        ]);
        if($info && is_array($info)){
            foreach ($info as $val){
                $extend_info = json_decode($val['extend_info'] , true);
                if($extend_info && is_array($extend_info)){
                    $data[] = [
                        'uid' => $val['uid'],
                        'area_name' => $extend_info['area_name'],
                        'house_size' => $extend_info['house_size'],
                        'floor_plan_pic_url' => $extend_info['floor_plan_pic_url'],
                        'rock_plate_place' => $extend_info['rock_plate_place'],
                        'case_pic_url' => self::CASE_PIC_URL[$val['uid']]
                    ];
                }

            }
        }
        $this->setSuccess($data);
    }


}